import resource from 'vueResourceConfig'
export default {
  doSomething () {
    return resource('/404').get({})
  },

  getProgramList() {
    let _data = [{
        id: 1,
        name: 'program 1',
        description: 'this is program 1'
    }, {
        id: 2,
        name: 'program 2',
        description: 'this is program 2'
    }, {
        id: 3,
        name: 'program 3',
        description: 'this is program 3'
    }]
    return Promise.resolve(_data);
  },

  getWorkoutList(baseProgramId) {
    let program = baseProgramId ? {
      id: baseProgramId,
      workouts: [ 1, 3]
    } : null;
    let _data = {
      workouts: [{
        id: 0,
        name: 'workout 1',
        tag: ['aa'],
        type: 'PT'
      }, {
        id: 1,
        name: 'workout 2',
        tag: ['bbb'],
        type: 'VPT'
      }, {
        id: 2,
        name: 'workout 3',
        tag: ['ccccc'],
        type: 'PT'
      }, {
        id: 3,
        name: 'workout 4',
        tag: ['aa', 'bbb'],
        type: 'PT'
      }, {
        id: 4,
        name: 'workout 5',
        tag: ['cccc', 'dd'],
        type: 'VPT'
      }],
      program: program
    }

    return Promise.resolve(_data);
  },

  putProgram(program) {
    console.log('#api level: ', program)
    return Promise.resolve();
  }
}
